package com.l.system.controller;

import com.l.system.domain.UserDT;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Williams on 2015/9/5.
 */

@Controller
public class HomeController {

    @RequestMapping("/")
    public ModelAndView index() {
        return new ModelAndView("index");
    }

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public ModelAndView login(UserDT userDT) {
        ModelAndView mav = new ModelAndView("/welcome");
        if (userDT!=null) {
            mav.addObject("user",userDT);
        }
        return mav;
    }

}
